#字符串中的单词反转
class Solution(object):
    def reverseMessage(self, message):
        """
        :type message: str
        :rtype: str
        """
        tokens = message.split()

        tokens.reverse()
        return ' '.join(tokens)


#旋转字符串
class Solution(object):
    def rotateString(self, s, goal):
        """
        :type s: str
        :type goal: str
        :rtype: bool
        """
        if len(s) != len(goal):
            return False
        return goal in s + s

# 统计是给定字符串前缀的字符串数目
class Solution(object):
    def countPrefixes(self, words, s):
        """
        :type words: List[str]
        :type s: str
        :rtype: int
        """
        count = 0
        for word in words:
            if s.startswith(word):
                count += 1
        return count



















